﻿<navigation:Page x:Class="Showroom.Views.Templatization"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:fl="clr-namespace:SStuff.FlowControls;assembly=SStuff.FlowControls"
    xmlns:vm="clr-namespace:Showroom.ViewModels"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="FlowLayouts - Templates">
    <navigation:Page.DataContext>
        <vm:InCoverFlowContentControlSampleData />
    </navigation:Page.DataContext>
    <navigation:Page.Resources>
        <Style TargetType="fl:FlowItem2D" x:Key="empty2D">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="fl:FlowItem2D">
                        <ContentPresenter />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="fl:FlowItem3D" x:Key="empty3D">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="fl:FlowItem3D">
                        <ContentPresenter />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <DataTemplate x:Key="itemTemplate">
            <fl:InFlowContentControl Content="{Binding ColorName}" Background="{Binding Brush}" HeadingBackground="{Binding HeaderBrush}" Width="150" Height="150" />
            
        </DataTemplate>
    </navigation:Page.Resources>
    <Grid x:Name="LayoutRoot" >
        <Grid.RowDefinitions>
            <RowDefinition Height=".5*" />
            <RowDefinition Height=".5*" />
        </Grid.RowDefinitions>
        <TextBlock TextWrapping="Wrap" Text="The following FlowItemsControl2D and FlowItemsControl3D have an ItemTemplate containing an InFlowContentControl that enables easy xaml only stylisation" Style="{StaticResource ContentTextStyle}" />
        <fl:FlowItemsControl2D ItemsSource="{Binding Items}" ItemTemplate="{StaticResource itemTemplate}" ItemContainerStyle="{StaticResource empty2D}" />
        <fl:FlowItemsControl3D Grid.Row="1" ItemsSource="{Binding Items}" ItemTemplate="{StaticResource itemTemplate}" ItemContainerStyle="{StaticResource empty3D}" />
    </Grid>
</navigation:Page>
